Post

Replies

Boosts

Views

Activity

Comment on New iOS String Initializer can't get correct localized String for specific locale
Thanks for your reply, it helped me to figure out the use of locale, it seems I had a problem understanding locale in String before. I used the new Formatter API ParseableFormatStyle and tried to let it be used to specify the text in the output by the following code let colorString = UIColorFormatStyle().mark().locale(Locale(identifier: "zh-cn")).format(UIColor.blue) Looks like I need to tweak the string handling a bit. https://www.fatbobman.com/posts/newFormatter/
Topic: App & System Services SubTopic: General Tags:
Oct ’21
Comment on SwiftData #Predicate cannot test for nil relationship
func query(group: Group) { let id = group.id let predicate = #Predicate<Item> { item in item.group?.id == id // Compiles } } @MarcusAurelius This method can indeed compile, but when I use similar code to run, the following error message will appear: Thread 1: Fatal error: Couldn't find \Tag.id on Tag with fields May I ask if your code can use the above predicate to fetch data?
Sep ’23
Comment on Is Core Data hosted in CloudKit working in Xcode 13?
same for me , IOS 15 & Monterey with Xcode 13 Beta 4 .
Replies
Boosts
Views
Activity
Aug ’21
Comment on New iOS String Initializer can't get correct localized String for specific locale
Thanks for your reply, it helped me to figure out the use of locale, it seems I had a problem understanding locale in String before. I used the new Formatter API ParseableFormatStyle and tried to let it be used to specify the text in the output by the following code let colorString = UIColorFormatStyle().mark().locale(Locale(identifier: "zh-cn")).format(UIColor.blue) Looks like I need to tweak the string handling a bit. https://www.fatbobman.com/posts/newFormatter/
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Comment on New iOS String Initializer can't get correct localized String for specific locale
After the previous explanation, I have no more questions about the current behavior of this method. locale is used here to interpolate values for strings as a guide. Since I've been hoping Apple would provide an API to get the localizedString for a specific locale, for now I can only try to get it via Bundle directly.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Comment on NSPersistentCloudKitContainer Bug
Does context.delete mean delete the NSManagedObject instance locally? So far, this method should indeed work. Still hope Apple will provide a better solution. So far, I haven't received any response from Apple.
Replies
Boosts
Views
Activity
Oct ’21
Comment on SwiftData #Predicate cannot test for nil relationship
func query(group: Group) { let id = group.id let predicate = #Predicate<Item> { item in item.group?.id == id // Compiles } } @MarcusAurelius This method can indeed compile, but when I use similar code to run, the following error message will appear: Thread 1: Fatal error: Couldn't find \Tag.id on Tag with fields May I ask if your code can use the above predicate to fetch data?
Replies
Boosts
Views
Activity
Sep ’23
Comment on Using if statement in .overlay causes app to freeze when using withAnimation
It's difficult to provide a precise explanation, but in SwiftUI, it's best to follow these two principles: Avoid changing a view's open/close state simultaneously with other states. Adding a slight delay can help avoid many issues. Avoid animating states that don't need to be animated.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’24